package com.zy;

import com.zy.bean.Student;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author LittleDesire
 * @description
 * @date 2022-03-28 周一 16:28
 * @since 17
 */
public class App {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml");
        // 默认调用 无参构造方法
        Student student = (Student)ac.getBean("student");
        /*Student bean = ac.getBean(Student.class);
        Student studentID = ac.getBean("studentID", Student.class);
        System.out.println(studentID);
        System.out.println(bean);*/
        System.out.println(student);


        // com.zy.bean.Student@212bf671 通过静态工厂去创建Student类
        //System.out.println(ac.getBean("s"));


        // com.zy.bean.Student@212bf671 通过动态工厂去创建Student类
        //System.out.println(ac.getBean("ss"));

    }
}
